package com.ares.aler.service.impl;

import com.ares.aler.entiy.UniversityArticlePo;
import com.ares.aler.mapper.UniversityArticleMapperDao;
import com.ares.aler.service.UniversityArticleDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class UniversityArticleDaoImpl implements UniversityArticleDao {

    @Autowired
    UniversityArticleMapperDao universityArticleMapperDao ;


    @Override
    public Map selectAllMap(int page, int limit) {
        Map selectAllMap = new HashMap();
        page = (page - 1)*limit;
        List<UniversityArticlePo> UnArticlePoList = universityArticleMapperDao.selectArtice(page, limit);
        int count = universityArticleMapperDao.selectCount();
        selectAllMap.put("data",UnArticlePoList);
        selectAllMap.put("code",0);
        selectAllMap.put("count",count);
        selectAllMap.put("msg","");
        return selectAllMap;
    }
}
